package com.athuiju.hr.controller.front;


import com.athuiju.commonutils.R;
import com.athuiju.hr.entity.VisitPost;
import com.athuiju.hr.service.VisitPostService;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author wzh
 * @since 2022-01-02
 */
@RestController
@RequestMapping("/hr/visit-post")
@Api(value="应聘岗位列表controller",tags={"小程序应聘岗位列表操作接口"})
public class VisitPostController {
    @Autowired
    public VisitPostService visitPostService;

    @ApiOperation(value = "查询全部岗位controller")
    @GetMapping("visitPostAll")
    @ApiResponses({@ApiResponse(code = 200,message = "OK",response = VisitPost.class),
    })
    public R list(){
        List<VisitPost> list=visitPostService.list(null);
        return  R.ok().data("item",list);
    }

    @ApiOperation(value = "根据id查询岗位信息controller")
    @GetMapping("getVisitPostInfo/{id}")
    @ApiResponses({@ApiResponse(code = 200,message = "OK",response = VisitPost.class),
    })
    public R getVisitPostInfo(@ApiParam(name = "id",value = "岗位id",required = true)
                           @PathVariable String id){
        VisitPost visitPost=visitPostService.getById(id);
        return  R.ok().data("visitPost",visitPost);
    }

}